package com.jshan.blog.enums;

import lombok.Getter;

@Getter
public enum AccountStatusEnum {
    ACCOUNT_DISABLE(1000002, "禁用"),
    ACCOUNT_NORMAL(1000001, "正常"),
    ACCOUNT_SILENCE(1000003, "禁言"),
    ;
    private Integer code;
    private String desc;

    AccountStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static AccountStatusEnum getByCode(Integer code) {
        for (AccountStatusEnum accountStatusEnum : AccountStatusEnum.values()) {
            if (accountStatusEnum.getCode().equals(code)) {
                return accountStatusEnum;
            }
        }
        return null;
    }
}
